function goToRegister() {
    window.location.href = "register.jsp";
}

document.addEventListener("DOMContentLoaded", function() {
    // 获取 URL 参数中的错误信息
    var url = window.location.href;
    var index = url.indexOf('error=');
    var error = url.substring(index + 6, url.length);

    if (error && error === '1') {
        window.alert('用户名或密码错误');
    }

    if(error && error === '2'){
        window.alert('验证码错误');
    }
});